<?php /*a:4:{s:64:"/www/wwwroot/pay.rym.best/application/user/view/index/index.html";i:1563242586;s:64:"/www/wwwroot/pay.rym.best/application/user/view/common/head.html";i:1563242578;s:66:"/www/wwwroot/pay.rym.best/application/user/view/common/head_s.html";i:1563242578;s:66:"/www/wwwroot/pay.rym.best/application/user/view/common/footer.html";i:1563242578;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title><?php echo htmlentities($title); ?>-<?php echo htmlentities($sys['name']); ?><?php echo htmlentities($userInfo['voice']); ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="<?php echo htmlentities($sys['key']); ?>">
    <meta name="description" content="<?php echo htmlentities($sys['des']); ?>">
    <link rel="shortcut icon" href="/favicon.ico"/>  
    <link rel="stylesheet" href="/static/plugins/layui/css/layui.css">
    <link rel="stylesheet" href="/static/user/css/main.css">
    <link rel="stylesheet" href="/static/common/css/font.css" media="all">
</head>
<script src="/static/plugins/layui/layui.js"></script> 
<script src='https://cdn.bootcss.com/socket.io/2.0.3/socket.io.js'></script>  
<script type="text/javascript">
function playv(){
    //消息提示音
    var audio = document.createElement("audio");
    if (audio.canPlayType("audio/mp3")) {
        audio.src = "/static/default.mp3";
    }else if(audio.canPlayType("audio/ogg")) {
        audio.src = "/static/default.ogg";
    } 
    audio.play();//消息提示音 END    
}
// 订单消息同步通知
layui.use(['layer','jquery'], function() {
    var layer = layui.layer,$ = layui.jquery;
    var socket = io('http://'+document.domain+':2120');   // 连接服务端
    socket.on('new_msg', function(msg){ // 后端推送来消息时            
        arr=msg.split("|");
        var m_userid=arr[0];
        var m_agentid=arr[1];
        var userid="<?php echo htmlentities($userInfo['id']); ?>"; 
        var voice="<?php echo htmlentities($userInfo['voice']); ?>"; 
        if(m_userid!='0' && m_userid==userid){                
            layer.msg("您有新订单提醒",{time:2000,icon:1},function(){   
                window.frames['main_pan'].location.href = "<?php echo url('user/order/index'); ?>";     
            });  
            if(voice=='open'){
                playv();
            }           
        }
        if(m_agentid!='0' && m_agentid==userid){             
            layer.msg("您有新的代理订单提醒",{time:2000,icon:1},function(){  
                window.frames['main_pan'].location.href = "<?php echo url('user/agent/orderlist'); ?>";   
            });   
            if(voice=='open'){
                playv();
            }  
        } 
    }); 
}); 
</script>

<body>
<div id="header">
    <a class="logo" href="<?php echo url('user/index/index'); ?>" title="<?php echo htmlentities($sys['name']); ?>"><img src="<?php echo htmlentities($sys['logo']); ?>"></a>
    <div class="usinfo">
    <a class="layui-btn layui-btn-primary layui-btn-sm" style="border-color: #fff">您好，<?php echo htmlentities($userInfo['username']); ?></a>
    <a href="<?php echo url('set/index'); ?>"  target="main_pan" class="layui-btn layui-btn-primary layui-btn-sm">设置</a>
    <a href="<?php echo url('index/logout'); ?>" class="layui-btn layui-btn-primary layui-btn-sm">退出</a>
    </div> 
</div>

<div id="leftnav">
    <ul>
        <li><a href="<?php echo url('user/index/index'); ?>"><i class="layui-icon">&#xe68e;</i> 码商概况</a></li>
        <?php echo $dailinav; ?>
        <li><a href="<?php echo url('user/channel/index'); ?>" target="main_pan"><i class="layui-icon">&#xe857;</i> 通道管理</a></li>
        <li><a href="<?php echo url('user/order/index'); ?>" target="main_pan"><i class="layui-icon">&#xe63c;</i> 订单管理</a></li>
        <li><a href="<?php echo url('user/settle/index'); ?>" target="main_pan"><i class="layui-icon">&#xe65e;</i> 财务管理</a></li>
        <!-- <li><a href="<?php echo url('user/financial/index'); ?>" target="main_pan"><i class="layui-icon">&#xe65e;</i> 财务管理</a></li> -->
        <li><a href="<?php echo url('user/set/index'); ?>" target="main_pan"><i class="layui-icon">&#xe673;</i> 修改密码</a></li>
    </ul>
</div>  
<div id="main"><iframe src="<?php echo url('user/index/main'); ?>" name="main_pan" frameborder="0" style="height: 100%; width: 100%; border: 0px; background: #fff"></iframe></div>
<div id="footer">
    <p>2018 &copy; <a href="<?php echo htmlentities($sys['url']); ?>"><?php echo htmlentities($sys['name']); ?></a></p>
</div>  


</body>
</html>